package br.com.devschool.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import br.com.devschool.util.BaseEntity;

/**
 * @author ATILLA
 *
 */
@Entity
@Table
public class Pagamento extends BaseEntity implements Serializable {

	private static final long serialVersionUID = 797168982709110022L;

	private Date 		dataCadastro;
	private Double 		valor;
	private Matricula 	matricula;
	private Turma 		turma;
	
	public Pagamento(Integer id, Date dataCadastro, Double valor, 
			Matricula matricula, Turma turma) {
		super(id);
		this.dataCadastro 	= dataCadastro;
		this.valor 			= valor;
		this.matricula 		= matricula;
		this.turma 			= turma;
	}
	
	public Pagamento() { }

	@Column(name="data_cadastro")
	@Temporal(TemporalType.DATE)
	public Date getDataCadastro() {
		return dataCadastro;
	}
	
	public void setDataCadastro(Date dataCadastro) {
		this.dataCadastro = dataCadastro;
	}

	public Double getValor() {
		return valor;
	}

	public void setValor(Double valor) {
		this.valor = valor;
	}

	@ManyToOne
	@JoinColumn(name="id_matricula")
	public Matricula getMatricula() {
		return matricula;
	}

	public void setMatricula(Matricula matricula) {
		this.matricula = matricula;
	}

	@ManyToOne
	@JoinColumn(name="id_turma")
	public Turma getTurma() {
		return turma;
	}

	public void setTurma(Turma turma) {
		this.turma = turma;
	}
	
}
